import 'package:flutter/material.dart';
import '../../helper/cacheHelper.dart';
import '../../helper/channelHelper.dart';
import '../../helper/uidata.dart';
import '../../model/docsend.dart';

import '../../model/signitem.dart';
import '../../pages/homex/upFilePanel.dart';

import '../../widgets/inputWidget.dart';

import '../../model/user.dart';
import '../../widgets/userSelect.dart';
import '../../helper/Helper.dart';

class DocSendHuiZhiPage extends StatefulWidget {
  DocSendHuiZhiPage(this.s1, this.callback);
  final DocSend s1;
  final RefrushCallback callback;

  @override
  DocSendHuiZhiPageState createState() => new DocSendHuiZhiPageState();
}

class DocSendHuiZhiPageState extends State<DocSendHuiZhiPage> {
  final String now = Helper.DateTimeNowString();
  late SignItem sh, qf;
  List<SignItem> hq = <SignItem>[];
  String spaceID = Helper.GetGuid();
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      //backgroundColor: Colors.white,
      appBar: AppBar(
        title: Text("发文审批"),
      ),
      body: DocSendHuiZhiBody(context),
    );
  }

  DocSendHuiZhiBody(BuildContext context) => SingleChildScrollView(
        child: DocSendHuiZhiFields(context),
      );

  List<Widget> getWidgetList(BuildContext context) {
    List<Widget> list1 = <Widget>[];
    List<Widget> list2 = <Widget>[];
    List<Widget> list3 = <Widget>[];
    List<Widget> list4 = <Widget>[];
    List<Widget> list5 = <Widget>[];

    list3.add(InputWidget.getInfo("发文标题", widget.s1.Title));
    list3.add(InputWidget.getDivider());
    list3.add(InputWidget.getInfo2("发文详情", widget.s1.Content));

    list1.add(InputWidget.inCard2(list3));

    list4.add(Container(
        child: UpFilePanel(
      "归档文件",
      widget.s1.FileSpaceId,
    )));

    list1.add(InputWidget.inCard2(list4));
    list1.add(InputWidget.inCard2(list5));

    return list1;
  }

  DocSendHuiZhiFields(BuildContext context) => Container(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.end,
          children: getWidgetList(context),
        ),
      );
}
